﻿using System.ComponentModel;
using SilverPop.UI.Domain;
using SilverPop.UI.Services;

namespace SilverPop.UI.ViewModels
{
	public class TitleBarViewModel : INotifyPropertyChanged
	{
		private NotePage _notePage;

		public string Title
		{
			get
			{
				return _notePage.Title;
			}
			set
			{
				_notePage.Title = value;
				DoPropertyChanged("Title");
			}
		}

		public TitleBarViewModel(INoteDataService noteData)
		{
			_notePage = noteData.GetNotes();
		}

		public event PropertyChangedEventHandler PropertyChanged;
		private void DoPropertyChanged(string propertyName)
		{
			if( PropertyChanged != null )
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}
	}
}
